
enum {
	AU_ULAW = 1,
	AU_PCM8 = 2,
	AU_PCM16,
	AU_PCM24,
	AU_PCM32,
	AU_FLOAT32 = 6,
	AU_FLOAT64,
	AU_FIXED8 = 10,
	AU_FIXED16,
	AU_FIXED24,
	AU_FIXED32,
	AU_ALAW = 27,
	AU_ENCMAX = 27
};

#define AU_MAGIC UINT32_C(0x2E736E64)
#define AU_COUNT 6
#define AU_SIZE (AU_COUNT * sizeof(uint32_t))
#define AU_INITIALIZER { AU_SIZE, UINT32_MAX, AU_PCM16, 48000, 1 }
struct au {
	uint32_t au_off;
	uint32_t au_size;
	uint32_t au_enc;
	uint32_t au_rate;
	uint32_t au_chan;
};

#define au_vsize(au) au_encsize((au)->au_enc)
#define au_ssize(au) (au_vsize(au) * (au)->au_chan)
#define au_bswap(au, b, s) au_encbswap((au)->au_enc, (b), (s))
#define au_nswap(au, b, s) au_encnswap((au)->au_enc, (b), (s))

int		 au_gethdr(struct au *, const void *);
int		 au_puthdr(struct au *, void *);
const char	*au_encstr(uint32_t);
#define au_strenc(str) au_strencp((str), NULL)
uint32_t	 au_strencp(const char *, const char **);
size_t		 au_encsize(uint32_t);
int		 au_encbswap(uint32_t, void *, size_t);
int		 au_encnswap(uint32_t, void *, size_t);
